home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Hardware / Mac OS USB DDK / Mac OS USB DDK 1.4.1 / Examples / USBSampleStorageDriver / StorageClassDriver / StorageClassDriver.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-25  |  1.8 KB  |  50 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        StorageClassDriver.h
  3.  
  4.     Contains:    All structures and definitions used by all components of
  5.                 the Storage Class Driver
  6.  
  7.     Version:    1.3
  8.  
  9.     Copyright:    © 1998-1999 by Apple Computer, Inc., all rights reserved.
  10. */
  11.  
  12.  
  13. #ifndef __STORAGECLASSDRIVERH__
  14. #define __STORAGECLASSDRIVERH__
  15.  
  16. #include <USB.h>
  17. #include "StorageClassPublicAPI.h"
  18. #include "StorageDeviceConfiguration.h"
  19.  
  20. #define kStorageRetryCount        5
  21. #define kUSBMaxBulkTransfer        0x200000    // Max transfer is 2MB
  22.  
  23. #define kDeviceVendorID        kDriverVendorID            // USB Vendor ID
  24. #define kDeviceProductID    kDriverProductID            // USB Product ID.
  25. #define kDeviceClass        kDriverClassID
  26. #define kDeviceSubClass        kDriverSubclassID
  27.  
  28. //
  29. // These functions are found in StorageClassDriver.c
  30. //
  31. extern void     StorageDriverEntry(    USBDeviceRef deviceRef, USBDeviceDescriptorPtr deviceDescriptorPtr, USBInterfaceDescriptorPtr pInterfaceDescriptor );
  32. extern void     StorageClassDriverFinalize( void );
  33. extern OSStatus    StorageClassDriverNotifyProc(UInt32    notification, void* pointer, UInt32 refcon);
  34. extern Boolean    IsThisASupportedProtocol( UInt8 theProtocol );
  35.  
  36. // These are the prototypes for utility functions -- should propably be in a seperate module
  37. extern void     InitParamBlock(USBDeviceRef theDeviceRef, USBPB* paramblock);
  38. extern OSStatus ClearFeatureEndpointStall( USBPB *usbPB, USBPipeRef pipeRefForEndpoint, USBCompletion completionProc, UInt32 refCon);
  39. extern OSStatus GetStatusEndpointStatus( USBPB *usbPB, USBPipeRef pipeRefForEndpoint, USBCompletion completionProc, Ptr Buffer, UInt32 refCon);
  40.  
  41. // Accessors for USB references
  42. extern UInt8         GetInterfaceSubclass( void );
  43. extern UInt32        GetInterfaceNumber( void );
  44. extern USBDeviceRef    GetInterfaceRef( void );
  45. extern USBPipeRef     GetBulkInPipeRef( void );
  46. extern USBPipeRef     GetBulkOutPipeRef( void );
  47. extern USBPipeRef     GetInterruptPipeRef( void );
  48.  
  49.  
  50. #endif //__STORAGECLASSDRIVERH__